package com.prb.web.interceptor;

import com.prb.ip.filter.common.IpHolder;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class IpInterceptor implements HandlerInterceptor {


    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {

        System.out.println("ip interceptor exec");
        IpHolder.self.putIp(request.getRemoteAddr());

        return true;
    }
}
